<%-- 
    Document   : comment
    Created on : 2 avr. 2013, 21:37:16
    Author     : Alice
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>

<jsp:include page="header.jsp"></jsp:include>

<s:div id="bloc_contenu">
    <table border="0" width="845px">
        <tr>

            <td width="500"valign="top" class="td_miniature"><img src="pages/img/img_produit_type/<s:property value="%{#parameters.idProductType}"/>.jpg"/>
            </td>
            <td valign="top">
                <s:div id="bloc_commentaire">
                    <b>
                        <c:if test="${not empty productTitle}">
                            ${productTitle}
                        </c:if>
                        <c:if test="${empty productTitle}">
                            <s:property value="%{#parameters.title}"/>
                        </c:if>

                    </b><br /><br />

                    <c:if test="${not empty productDescription}">
                        ${productDescription}
                    </c:if>
                    <c:if test="${empty productDescription}">
                        <s:property value="%{#parameters.description}"/>
                    </c:if>

                    <s:div cssClass="bloc_formulaire_commentaire">
                        <h2>Ecrire un avis</h2>



                        <c:if test="${not empty message}">
                            <font color="green"> ${message}</font><br /><br /><s:a action="ficheProduit" includeParams="get"><s:param name="idProduct" value="%{#parameters.idProductType}"/>Retourner sur la fiche produit</s:a><br /><br />
                        </c:if>

                        <c:if test="${empty message}">
                            <s:form namespace="/" action="postComment">
                                <s:hidden name="idProductType" value="%{#parameters.idProductType}"></s:hidden>
                                <s:textarea name="comment_area" cols="50" rows="7"></s:textarea>
                                <s:hidden name="productTitle" value="%{#parameters.title}"></s:hidden>
                                <s:hidden name="productDescription" value="%{#parameters.description}"></s:hidden>
                                <s:submit type="image" value="valider" src="pages/img/btn_valider.png" cssClass="espace_top"/>
                            </s:form>
                        </c:if>
                    </s:div>
                </s:div>
        </tr>
    </table>
</s:div>

<jsp:include page="footer.jsp"></jsp:include>
